/**
 */
package MobileApplicationDeveloper.model.impl;

import MobileApplicationDeveloper.model.ModelPackage;
import MobileApplicationDeveloper.model.Setting;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Setting</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link MobileApplicationDeveloper.model.impl.SettingImpl#getSettingName <em>Setting Name</em>}</li>
 *   <li>{@link MobileApplicationDeveloper.model.impl.SettingImpl#getColor <em>Color</em>}</li>
 *   <li>{@link MobileApplicationDeveloper.model.impl.SettingImpl#getFontType <em>Font Type</em>}</li>
 *   <li>{@link MobileApplicationDeveloper.model.impl.SettingImpl#getBackgroundColor <em>Background Color</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class SettingImpl extends MinimalEObjectImpl.Container implements Setting {
	/**
	 * The default value of the '{@link #getSettingName() <em>Setting Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSettingName()
	 * @generated
	 * @ordered
	 */
	protected static final String SETTING_NAME_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getSettingName() <em>Setting Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSettingName()
	 * @generated
	 * @ordered
	 */
	protected String settingName = SETTING_NAME_EDEFAULT;

	/**
	 * The default value of the '{@link #getColor() <em>Color</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getColor()
	 * @generated
	 * @ordered
	 */
	protected static final String COLOR_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getColor() <em>Color</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getColor()
	 * @generated
	 * @ordered
	 */
	protected String color = COLOR_EDEFAULT;

	/**
	 * The default value of the '{@link #getFontType() <em>Font Type</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getFontType()
	 * @generated
	 * @ordered
	 */
	protected static final String FONT_TYPE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getFontType() <em>Font Type</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getFontType()
	 * @generated
	 * @ordered
	 */
	protected String fontType = FONT_TYPE_EDEFAULT;

	/**
	 * The default value of the '{@link #getBackgroundColor() <em>Background Color</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getBackgroundColor()
	 * @generated
	 * @ordered
	 */
	protected static final String BACKGROUND_COLOR_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getBackgroundColor() <em>Background Color</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getBackgroundColor()
	 * @generated
	 * @ordered
	 */
	protected String backgroundColor = BACKGROUND_COLOR_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected SettingImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return ModelPackage.Literals.SETTING;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getSettingName() {
		return settingName;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setSettingName(String newSettingName) {
		String oldSettingName = settingName;
		settingName = newSettingName;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.SETTING__SETTING_NAME, oldSettingName, settingName));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getColor() {
		return color;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setColor(String newColor) {
		String oldColor = color;
		color = newColor;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.SETTING__COLOR, oldColor, color));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getFontType() {
		return fontType;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setFontType(String newFontType) {
		String oldFontType = fontType;
		fontType = newFontType;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.SETTING__FONT_TYPE, oldFontType, fontType));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getBackgroundColor() {
		return backgroundColor;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setBackgroundColor(String newBackgroundColor) {
		String oldBackgroundColor = backgroundColor;
		backgroundColor = newBackgroundColor;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.SETTING__BACKGROUND_COLOR, oldBackgroundColor, backgroundColor));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case ModelPackage.SETTING__SETTING_NAME:
				return getSettingName();
			case ModelPackage.SETTING__COLOR:
				return getColor();
			case ModelPackage.SETTING__FONT_TYPE:
				return getFontType();
			case ModelPackage.SETTING__BACKGROUND_COLOR:
				return getBackgroundColor();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case ModelPackage.SETTING__SETTING_NAME:
				setSettingName((String)newValue);
				return;
			case ModelPackage.SETTING__COLOR:
				setColor((String)newValue);
				return;
			case ModelPackage.SETTING__FONT_TYPE:
				setFontType((String)newValue);
				return;
			case ModelPackage.SETTING__BACKGROUND_COLOR:
				setBackgroundColor((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case ModelPackage.SETTING__SETTING_NAME:
				setSettingName(SETTING_NAME_EDEFAULT);
				return;
			case ModelPackage.SETTING__COLOR:
				setColor(COLOR_EDEFAULT);
				return;
			case ModelPackage.SETTING__FONT_TYPE:
				setFontType(FONT_TYPE_EDEFAULT);
				return;
			case ModelPackage.SETTING__BACKGROUND_COLOR:
				setBackgroundColor(BACKGROUND_COLOR_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case ModelPackage.SETTING__SETTING_NAME:
				return SETTING_NAME_EDEFAULT == null ? settingName != null : !SETTING_NAME_EDEFAULT.equals(settingName);
			case ModelPackage.SETTING__COLOR:
				return COLOR_EDEFAULT == null ? color != null : !COLOR_EDEFAULT.equals(color);
			case ModelPackage.SETTING__FONT_TYPE:
				return FONT_TYPE_EDEFAULT == null ? fontType != null : !FONT_TYPE_EDEFAULT.equals(fontType);
			case ModelPackage.SETTING__BACKGROUND_COLOR:
				return BACKGROUND_COLOR_EDEFAULT == null ? backgroundColor != null : !BACKGROUND_COLOR_EDEFAULT.equals(backgroundColor);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (settingName: ");
		result.append(settingName);
		result.append(", color: ");
		result.append(color);
		result.append(", fontType: ");
		result.append(fontType);
		result.append(", backgroundColor: ");
		result.append(backgroundColor);
		result.append(')');
		return result.toString();
	}

} //SettingImpl
